3.2.72 \(\int \frac {\tan (c+d x)}{a+b \sin (c+d x)} \, dx\) [172]

Optimal. Leaf size=74 \[ -\frac {\log (1-\sin (c+d x))}{2 (a+b) d}-\frac {\log (1+\sin (c+d x))}{2 (a-b) d}+\frac {a \log (a+b \sin (c+d x))}{\left (a^2-b^2\right ) d} \]

[Out]

-1/2*ln(1-sin(d*x+c))/(a+b)/d-1/2*ln(1+sin(d*x+c))/(a-b)/d+a*ln(a+b*sin(d*x+c))/(a^2-b^2)/d

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {2800, 815} \begin {gather*} \frac {a \log (a+b \sin (c+d x))}{d \left (a^2-b^2\right )}-\frac {\log (1-\sin (c+d x))}{2 d (a+b)}-\frac {\log (\sin (c+d x)+1)}{2 d (a-b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]/(a + b*Sin[c + d*x]),x]

[Out]

-1/2*Log[1 - Sin[c + d*x]]/((a + b)*d) - Log[1 + Sin[c + d*x]]/(2*(a - b)*d) + (a*Log[a + b*Sin[c + d*x]])/((a
^2 - b^2)*d)

Rule 815

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
d + e*x)^m*((f + g*x)/(a + c*x^2)), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rule 2800

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int \frac {\tan (c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {x}{(a+x) \left (b^2-x^2\right )} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {1}{2 (a+b) (b-x)}+\frac {a}{(a-b) (a+b) (a+x)}-\frac {1}{2 (a-b) (b+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {\log (1-\sin (c+d x))}{2 (a+b) d}-\frac {\log (1+\sin (c+d x))}{2 (a-b) d}+\frac {a \log (a+b \sin (c+d x))}{\left (a^2-b^2\right ) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 87, normalized size = 1.18 \begin {gather*} \frac {(-a+b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-(a+b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+a \log (a+b \sin (c+d x))}{(a-b) (a+b) d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]/(a + b*Sin[c + d*x]),x]

[Out]

((-a + b)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - (a + b)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + a*Log[
a + b*Sin[c + d*x]])/((a - b)*(a + b)*d)

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 71, normalized size = 0.96

method result size
derivativedivides \(\frac {-\frac {\ln \left (1+\sin \left (d x +c \right )\right )}{2 a -2 b}+\frac {a \ln \left (a +b \sin \left (d x +c \right )\right )}{\left (a +b \right ) \left (a -b \right )}-\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{2 a +2 b}}{d}\) \(71\)
default \(\frac {-\frac {\ln \left (1+\sin \left (d x +c \right )\right )}{2 a -2 b}+\frac {a \ln \left (a +b \sin \left (d x +c \right )\right )}{\left (a +b \right ) \left (a -b \right )}-\frac {\ln \left (\sin \left (d x +c \right )-1\right )}{2 a +2 b}}{d}\) \(71\)
risch \(\frac {i x}{a +b}+\frac {i c}{d \left (a +b \right )}+\frac {i x}{a -b}+\frac {i c}{d \left (a -b \right )}-\frac {2 i a x}{a^{2}-b^{2}}-\frac {2 i a c}{d \left (a^{2}-b^{2}\right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d \left (a +b \right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d \left (a -b \right )}+\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right )}{d \left (a^{2}-b^{2}\right )}\) \(175\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)/(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/(2*a-2*b)*ln(1+sin(d*x+c))+a/(a+b)/(a-b)*ln(a+b*sin(d*x+c))-1/(2*a+2*b)*ln(sin(d*x+c)-1))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 65, normalized size = 0.88 \begin {gather*} \frac {\frac {2 \, a \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{2} - b^{2}} - \frac {\log \left (\sin \left (d x + c\right ) + 1\right )}{a - b} - \frac {\log \left (\sin \left (d x + c\right ) - 1\right )}{a + b}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*a*log(b*sin(d*x + c) + a)/(a^2 - b^2) - log(sin(d*x + c) + 1)/(a - b) - log(sin(d*x + c) - 1)/(a + b))/
d

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 63, normalized size = 0.85 \begin {gather*} \frac {2 \, a \log \left (b \sin \left (d x + c\right ) + a\right ) - {\left (a + b\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (a - b\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, {\left (a^{2} - b^{2}\right )} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*a*log(b*sin(d*x + c) + a) - (a + b)*log(sin(d*x + c) + 1) - (a - b)*log(-sin(d*x + c) + 1))/((a^2 - b^2
)*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan {\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sin(d*x+c)),x)

[Out]

Integral(tan(c + d*x)/(a + b*sin(c + d*x)), x)

________________________________________________________________________________________

Giac [A]
time = 7.25, size = 71, normalized size = 0.96 \begin {gather*} \frac {\frac {2 \, a b \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{2} b - b^{3}} - \frac {\log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a - b} - \frac {\log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{a + b}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

1/2*(2*a*b*log(abs(b*sin(d*x + c) + a))/(a^2*b - b^3) - log(abs(sin(d*x + c) + 1))/(a - b) - log(abs(sin(d*x +
 c) - 1))/(a + b))/d

________________________________________________________________________________________

Mupad [B]
time = 6.73, size = 91, normalized size = 1.23 \begin {gather*} \frac {a\,\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}{d\,\left (a^2-b^2\right )}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )}{d\,\left (a-b\right )}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}{d\,\left (a+b\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)/(a + b*sin(c + d*x)),x)

[Out]

(a*log(a + 2*b*tan(c/2 + (d*x)/2) + a*tan(c/2 + (d*x)/2)^2))/(d*(a^2 - b^2)) - log(tan(c/2 + (d*x)/2) + 1)/(d*
(a - b)) - log(tan(c/2 + (d*x)/2) - 1)/(d*(a + b))

________________________________________________________________________________________